home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1987 July
/
Ahoy_Magazine_87-07_1987_Double_L_Side_A.d64
/
Binary Power 1
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
333b
|
9 lines
0 rem << cd43-4 >>
1 rem ==================================
2 rem commodares problem #39-3 :
3 print"[147] [194]inary [208]ower 1"
4 rem solution by
5 rem david alan wright
6 rem ==================================
10 input"number to convert";n:fori=7to0step-1:j=2^i:k=int(n/j):a$=right$(str$(k),1):b$=b$+a$:c$=a$+c$:x=x+k*2^abs(7-i):n=n-j*k:next:printb$,c$,x